﻿using System;
using System.ComponentModel;
using System.Xml.Serialization;

namespace Interscape.TwilioClient.Components
{

    /// <summary>
    /// A paged collection of <see cref="Transcription">Transcription</see> objects.
    /// </summary>
    [Serializable]
    [XmlRoot("Transcriptions")]
    public class TranscriptionList : PagedList<Transcription>
    {
    }

    /// <summary>
    /// A Transcription resource represents an outgoing Caller ID that you have registered with Twilio for use when making an outgoing call or using the Dial verb. 
    /// </summary>
    [Serializable]
    public class Transcription : BaseAccountInfo
    {

        #region Constructors

        /// <summary>
        /// Creates a new instance of the Transcription object.
        /// </summary>
        public Transcription() : base()
        {
        }

        /// <summary>
        /// Creates a new instance of the Transcription object.
        /// </summary>
        /// <param name="sid">A 34 character string that uniquely identifies this resource.</param>
        public Transcription(string sid) : base(sid)
        {
        }

        #endregion

        /// <summary>
        /// A human-readable string representing the status of the transcription. 
        /// </summary>
        /// <remarks>Potential values: "in-progress", "completed", "failed".</remarks>
        [XmlElement]
        public string Status { get; set; }

        /// <summary>
        /// The 34 character id of the Recording this Transcription was made of. 
        /// </summary>
        [XmlElement]
        public string RecordingSid { get; set; }

        /// <summary>
        /// The duration of audio that was transcribed, in seconds.
        /// </summary>
        [XmlElement]
        [DefaultValue(0)]
        public Int32 Duration { get; set; }

        /// <summary>
        /// The content of the transcription.
        /// </summary>
        [XmlElement]
        public string TranscriptionText { get; set; }

        /// <summary>
        /// The charge for this transcript in USD.
        /// </summary>
        /// <remarks>Populated after the transcript is completed. Note, this value may not be immediately available.</remarks>
        [XmlElement]
        [DefaultValue(0.00)]
        public long Price { get; set; }

    }
}
